#pragma once
#include "hashBacket.hpp"

namespace hash_backet
{
	template<typename K, typename V, typename Hash = HashFunc<K>>
	class unordered_map
	{
		using iterator = hash_backet::__Iterator_Hash<const K, V, Hash>;
		using HT = hash_backet::HashTable<const K, V, Hash>;
	public:
		unordered_map():_pht(new HT) {}
		~unordered_map()
		{
			delete _pht;
		}
	public:
		iterator begin()
		{
			return _pht->begin();
		}
		iterator end()
		{
			return _pht->end();
		}
		bool insert(const pair<K, V>& pr)
		{
			return _pht->insert(pr);
		}
		bool erase(const K& key)
		{
			return _pht->erase(key);
		}
		bool find(const K& key)
		{
			return _pht->find(key);
		}

	private:
		HT* _pht;
	};
}